package com.vinci.task.service.impl;

import com.vinci.task.entity.TbTaskCompletedBy;
import com.vinci.task.entity.TbTaskInfo;
import com.vinci.task.mapper.TbTaskCompletedByMapper;
import com.vinci.task.service.TbTaskCompletedByService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 任务完成人 服务实现类
 * </p>
 *
 * @author 张先生
 * @since 2021-12-14
 */
@Service
public class TbTaskCompletedByServiceImpl extends ServiceImpl<TbTaskCompletedByMapper, TbTaskCompletedBy> implements TbTaskCompletedByService {

    @Autowired(required = false)
    private TbTaskCompletedByMapper TbTaskCompletedByMapper;

    /**
     * 根据userId查询任务
     * @param userId
     * @return
     */

    @Override
    public List<TbTaskInfo> selectTaskCompletedByUserId(String userId) {

        List<TbTaskInfo> tbTaskInfos = null;
        try {
            tbTaskInfos = TbTaskCompletedByMapper.selectTaskCompletedByUserId(userId);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return tbTaskInfos;
    }

}
